
#region license
/// Copyright (c) 2007 Rodrigo B. de Oliveira, Jb Evain and the
/// individuals listed on the ChangeLog entries.
/// 
/// Permission is hereby granted, free of charge, to any person obtaining
/// a copy of this software and associated documentation files (the
/// "Software"), to deal in the Software without restriction, including
/// without limitation the rights to use, copy, modify, merge, publish,
/// distribute, sublicense, and/or sell copies of the Software, and to
/// permit persons to whom the Software is furnished to do so, subject to
/// the following conditions:
/// 
/// The above copyright notice and this permission notice shall be
/// included in all copies or substantial portions of the Software.
/// 
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
/// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
/// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
/// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
/// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
/// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
/// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#endregion
//
// DO NOT EDIT THIS FILE!
//
// This file was generated automatically by astgen.boo.
//


namespace Milo.Ast
{	
	public partial class CodeSerializer
	{
		public bool ShouldSerialize(TypeMemberModifiers value)
		{
			return value != TypeMemberModifiers.None;
		}
		
		public Expression Serialize(TypeMemberModifiers value)
		{
			return SerializeEnum("TypeMemberModifiers", (long)value);
		}

		public bool ShouldSerialize(MethodImplementationFlags value)
		{
			return value != MethodImplementationFlags.None;
		}
		
		public Expression Serialize(MethodImplementationFlags value)
		{
			return SerializeEnum("MethodImplementationFlags", (long)value);
		}

		public bool ShouldSerialize(ParameterModifiers value)
		{
			return value != ParameterModifiers.None;
		}
		
		public Expression Serialize(ParameterModifiers value)
		{
			return SerializeEnum("ParameterModifiers", (long)value);
		}

		public bool ShouldSerialize(StatementModifierType value)
		{
			return value != StatementModifierType.None;
		}
		
		public Expression Serialize(StatementModifierType value)
		{
			return SerializeEnum("StatementModifierType", (long)value);
		}

		public bool ShouldSerialize(BinaryOperatorType value)
		{
			return value != BinaryOperatorType.None;
		}
		
		public Expression Serialize(BinaryOperatorType value)
		{
			return SerializeEnum("BinaryOperatorType", (long)value);
		}

		public bool ShouldSerialize(UnaryOperatorType value)
		{
			return value != UnaryOperatorType.None;
		}
		
		public Expression Serialize(UnaryOperatorType value)
		{
			return SerializeEnum("UnaryOperatorType", (long)value);
		}

		override public void OnCompileUnit(Milo.Ast.CompileUnit node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.CompileUnit"));
			if (ShouldSerialize(node.Modules))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modules"),
						SerializeCollection("Milo.Ast.ModuleCollection", node.Modules)));
			}
			Push(mie);
		}

		override public void OnExplicitMemberInfo(Milo.Ast.ExplicitMemberInfo node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.ExplicitMemberInfo"));
			if (ShouldSerialize(node.InterfaceType))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("InterfaceType"),
						Serialize(node.InterfaceType)));
			}
			Push(mie);
		}

		override public void OnSimpleTypeReference(Milo.Ast.SimpleTypeReference node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.SimpleTypeReference"));
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			Push(mie);
		}

		override public void OnArrayTypeReference(Milo.Ast.ArrayTypeReference node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.ArrayTypeReference"));
			if (ShouldSerialize(node.ElementType))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ElementType"),
						Serialize(node.ElementType)));
			}
			if (ShouldSerialize(node.Rank))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Rank"),
						Serialize(node.Rank)));
			}
			Push(mie);
		}

		override public void OnCallableTypeReference(Milo.Ast.CallableTypeReference node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.CallableTypeReference"));
			if (ShouldSerialize(node.Parameters))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Parameters"),
						SerializeCollection("Milo.Ast.ParameterDeclarationCollection", node.Parameters)));
			}
			if (ShouldSerialize(node.ReturnType))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ReturnType"),
						Serialize(node.ReturnType)));
			}
			Push(mie);
		}

		override public void OnGenericTypeReference(Milo.Ast.GenericTypeReference node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.GenericTypeReference"));
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.GenericArguments))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("GenericArguments"),
						SerializeCollection("Milo.Ast.TypeReferenceCollection", node.GenericArguments)));
			}
			Push(mie);
		}

		override public void OnGenericTypeDefinitionReference(Milo.Ast.GenericTypeDefinitionReference node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.GenericTypeDefinitionReference"));
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.GenericPlaceholders))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("GenericPlaceholders"),
						Serialize(node.GenericPlaceholders)));
			}
			Push(mie);
		}

		override public void OnCallableDefinition(Milo.Ast.CallableDefinition node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.CallableDefinition"));
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Attributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.Parameters))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Parameters"),
						SerializeCollection("Milo.Ast.ParameterDeclarationCollection", node.Parameters)));
			}
			if (ShouldSerialize(node.GenericParameters))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("GenericParameters"),
						SerializeCollection("Milo.Ast.GenericParameterDeclarationCollection", node.GenericParameters)));
			}
			if (ShouldSerialize(node.ReturnType))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ReturnType"),
						Serialize(node.ReturnType)));
			}
			if (ShouldSerialize(node.ReturnTypeAttributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ReturnTypeAttributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.ReturnTypeAttributes)));
			}
			Push(mie);
		}

		override public void OnNamespaceDeclaration(Milo.Ast.NamespaceDeclaration node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.NamespaceDeclaration"));
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			Push(mie);
		}

		override public void OnImport(Milo.Ast.Import node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.Import"));
			if (ShouldSerialize(node.Namespace))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Namespace"),
						Serialize(node.Namespace)));
			}
			if (ShouldSerialize(node.AssemblyReference))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("AssemblyReference"),
						Serialize(node.AssemblyReference)));
			}
			if (ShouldSerialize(node.Alias))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Alias"),
						Serialize(node.Alias)));
			}
			Push(mie);
		}

		override public void OnModule(Milo.Ast.Module node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.Module"));
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Attributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.Members))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Members"),
						SerializeCollection("Milo.Ast.TypeMemberCollection", node.Members)));
			}
			if (ShouldSerialize(node.BaseTypes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("BaseTypes"),
						SerializeCollection("Milo.Ast.TypeReferenceCollection", node.BaseTypes)));
			}
			if (ShouldSerialize(node.Namespace))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Namespace"),
						Serialize(node.Namespace)));
			}
			if (ShouldSerialize(node.Imports))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Imports"),
						SerializeCollection("Milo.Ast.ImportCollection", node.Imports)));
			}
			if (ShouldSerialize(node.Globals))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Globals"),
						Serialize(node.Globals)));
			}
			if (ShouldSerialize(node.AssemblyAttributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("AssemblyAttributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.AssemblyAttributes)));
			}
			Push(mie);
		}

		override public void OnClassDefinition(Milo.Ast.ClassDefinition node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.ClassDefinition"));
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Attributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.Members))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Members"),
						SerializeCollection("Milo.Ast.TypeMemberCollection", node.Members)));
			}
			if (ShouldSerialize(node.BaseTypes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("BaseTypes"),
						SerializeCollection("Milo.Ast.TypeReferenceCollection", node.BaseTypes)));
			}
			Push(mie);
		}

		override public void OnStructDefinition(Milo.Ast.StructDefinition node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.StructDefinition"));
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Attributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.Members))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Members"),
						SerializeCollection("Milo.Ast.TypeMemberCollection", node.Members)));
			}
			if (ShouldSerialize(node.BaseTypes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("BaseTypes"),
						SerializeCollection("Milo.Ast.TypeReferenceCollection", node.BaseTypes)));
			}
			Push(mie);
		}

		override public void OnInterfaceDefinition(Milo.Ast.InterfaceDefinition node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.InterfaceDefinition"));
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Attributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.Members))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Members"),
						SerializeCollection("Milo.Ast.TypeMemberCollection", node.Members)));
			}
			if (ShouldSerialize(node.BaseTypes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("BaseTypes"),
						SerializeCollection("Milo.Ast.TypeReferenceCollection", node.BaseTypes)));
			}
			Push(mie);
		}

		override public void OnEnumDefinition(Milo.Ast.EnumDefinition node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.EnumDefinition"));
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Attributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.Members))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Members"),
						SerializeCollection("Milo.Ast.TypeMemberCollection", node.Members)));
			}
			if (ShouldSerialize(node.BaseTypes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("BaseTypes"),
						SerializeCollection("Milo.Ast.TypeReferenceCollection", node.BaseTypes)));
			}
			Push(mie);
		}

		override public void OnEnumMember(Milo.Ast.EnumMember node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.EnumMember"));
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Attributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.Initializer))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Initializer"),
						Serialize(node.Initializer)));
			}
			Push(mie);
		}

		override public void OnField(Milo.Ast.Field node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.Field"));
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Attributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.Type))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Type"),
						Serialize(node.Type)));
			}
			if (ShouldSerialize(node.Initializer))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Initializer"),
						Serialize(node.Initializer)));
			}
			Push(mie);
		}

		override public void OnProperty(Milo.Ast.Property node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.Property"));
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Attributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.Parameters))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Parameters"),
						SerializeCollection("Milo.Ast.ParameterDeclarationCollection", node.Parameters)));
			}
			if (ShouldSerialize(node.Getter))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Getter"),
						Serialize(node.Getter)));
			}
			if (ShouldSerialize(node.Setter))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Setter"),
						Serialize(node.Setter)));
			}
			if (ShouldSerialize(node.Type))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Type"),
						Serialize(node.Type)));
			}
			if (ShouldSerialize(node.ExplicitInfo))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ExplicitInfo"),
						Serialize(node.ExplicitInfo)));
			}
			Push(mie);
		}

		override public void OnEvent(Milo.Ast.Event node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.Event"));
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Attributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.Add))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Add"),
						Serialize(node.Add)));
			}
			if (ShouldSerialize(node.Remove))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Remove"),
						Serialize(node.Remove)));
			}
			if (ShouldSerialize(node.Raise))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Raise"),
						Serialize(node.Raise)));
			}
			if (ShouldSerialize(node.Type))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Type"),
						Serialize(node.Type)));
			}
			Push(mie);
		}

		override public void OnLocal(Milo.Ast.Local node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.Local"));
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			Push(mie);
		}

		override public void OnBlockExpression(Milo.Ast.BlockExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.BlockExpression"));
			if (ShouldSerialize(node.Parameters))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Parameters"),
						SerializeCollection("Milo.Ast.ParameterDeclarationCollection", node.Parameters)));
			}
			if (ShouldSerialize(node.ReturnType))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ReturnType"),
						Serialize(node.ReturnType)));
			}
			if (ShouldSerialize(node.Body))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Body"),
						Serialize(node.Body)));
			}
			Push(mie);
		}

		override public void OnMethod(Milo.Ast.Method node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.Method"));
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Attributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.Parameters))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Parameters"),
						SerializeCollection("Milo.Ast.ParameterDeclarationCollection", node.Parameters)));
			}
			if (ShouldSerialize(node.GenericParameters))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("GenericParameters"),
						SerializeCollection("Milo.Ast.GenericParameterDeclarationCollection", node.GenericParameters)));
			}
			if (ShouldSerialize(node.ReturnType))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ReturnType"),
						Serialize(node.ReturnType)));
			}
			if (ShouldSerialize(node.ReturnTypeAttributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ReturnTypeAttributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.ReturnTypeAttributes)));
			}
			if (ShouldSerialize(node.Body))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Body"),
						Serialize(node.Body)));
			}
			if (ShouldSerialize(node.Locals))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Locals"),
						SerializeCollection("Milo.Ast.LocalCollection", node.Locals)));
			}
			if (ShouldSerialize(node.ImplementationFlags))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ImplementationFlags"),
						Serialize(node.ImplementationFlags)));
			}
			if (ShouldSerialize(node.ExplicitInfo))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ExplicitInfo"),
						Serialize(node.ExplicitInfo)));
			}
			Push(mie);
		}

		override public void OnConstructor(Milo.Ast.Constructor node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.Constructor"));
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Attributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.Parameters))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Parameters"),
						SerializeCollection("Milo.Ast.ParameterDeclarationCollection", node.Parameters)));
			}
			if (ShouldSerialize(node.GenericParameters))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("GenericParameters"),
						SerializeCollection("Milo.Ast.GenericParameterDeclarationCollection", node.GenericParameters)));
			}
			if (ShouldSerialize(node.ReturnType))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ReturnType"),
						Serialize(node.ReturnType)));
			}
			if (ShouldSerialize(node.ReturnTypeAttributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ReturnTypeAttributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.ReturnTypeAttributes)));
			}
			if (ShouldSerialize(node.Body))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Body"),
						Serialize(node.Body)));
			}
			if (ShouldSerialize(node.Locals))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Locals"),
						SerializeCollection("Milo.Ast.LocalCollection", node.Locals)));
			}
			if (ShouldSerialize(node.ImplementationFlags))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ImplementationFlags"),
						Serialize(node.ImplementationFlags)));
			}
			if (ShouldSerialize(node.ExplicitInfo))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ExplicitInfo"),
						Serialize(node.ExplicitInfo)));
			}
			Push(mie);
		}

		override public void OnDestructor(Milo.Ast.Destructor node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.Destructor"));
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Attributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.Parameters))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Parameters"),
						SerializeCollection("Milo.Ast.ParameterDeclarationCollection", node.Parameters)));
			}
			if (ShouldSerialize(node.GenericParameters))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("GenericParameters"),
						SerializeCollection("Milo.Ast.GenericParameterDeclarationCollection", node.GenericParameters)));
			}
			if (ShouldSerialize(node.ReturnType))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ReturnType"),
						Serialize(node.ReturnType)));
			}
			if (ShouldSerialize(node.ReturnTypeAttributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ReturnTypeAttributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.ReturnTypeAttributes)));
			}
			if (ShouldSerialize(node.Body))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Body"),
						Serialize(node.Body)));
			}
			if (ShouldSerialize(node.Locals))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Locals"),
						SerializeCollection("Milo.Ast.LocalCollection", node.Locals)));
			}
			if (ShouldSerialize(node.ImplementationFlags))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ImplementationFlags"),
						Serialize(node.ImplementationFlags)));
			}
			if (ShouldSerialize(node.ExplicitInfo))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ExplicitInfo"),
						Serialize(node.ExplicitInfo)));
			}
			Push(mie);
		}

		override public void OnParameterDeclaration(Milo.Ast.ParameterDeclaration node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.ParameterDeclaration"));
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Type))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Type"),
						Serialize(node.Type)));
			}
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Attributes"),
						SerializeCollection("Milo.Ast.AttributeCollection", node.Attributes)));
			}
			Push(mie);
		}

		override public void OnGenericParameterDeclaration(Milo.Ast.GenericParameterDeclaration node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.GenericParameterDeclaration"));
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			Push(mie);
		}

		override public void OnDeclaration(Milo.Ast.Declaration node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.Declaration"));
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Type))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Type"),
						Serialize(node.Type)));
			}
			Push(mie);
		}

		override public void OnAttribute(Milo.Ast.Attribute node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.Attribute"));
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Arguments))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Arguments"),
						SerializeCollection("Milo.Ast.ExpressionCollection", node.Arguments)));
			}
			if (ShouldSerialize(node.NamedArguments))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("NamedArguments"),
						SerializeCollection("Milo.Ast.ExpressionPairCollection", node.NamedArguments)));
			}
			Push(mie);
		}

		override public void OnStatementModifier(Milo.Ast.StatementModifier node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.StatementModifier"));
			if (ShouldSerialize(node.Type))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Type"),
						Serialize(node.Type)));
			}
			if (ShouldSerialize(node.Condition))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Condition"),
						Serialize(node.Condition)));
			}
			Push(mie);
		}

		override public void OnGotoStatement(Milo.Ast.GotoStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.GotoStatement"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			if (ShouldSerialize(node.Label))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Label"),
						Serialize(node.Label)));
			}
			Push(mie);
		}

		override public void OnLabelStatement(Milo.Ast.LabelStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.LabelStatement"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			Push(mie);
		}

		override public void OnBlock(Milo.Ast.Block node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.Block"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			if (ShouldSerialize(node.Statements))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Statements"),
						SerializeCollection("Milo.Ast.StatementCollection", node.Statements)));
			}
			Push(mie);
		}

		override public void OnDeclarationStatement(Milo.Ast.DeclarationStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.DeclarationStatement"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			if (ShouldSerialize(node.Declaration))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Declaration"),
						Serialize(node.Declaration)));
			}
			if (ShouldSerialize(node.Initializer))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Initializer"),
						Serialize(node.Initializer)));
			}
			Push(mie);
		}

		override public void OnMacroStatement(Milo.Ast.MacroStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.MacroStatement"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Arguments))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Arguments"),
						SerializeCollection("Milo.Ast.ExpressionCollection", node.Arguments)));
			}
			if (ShouldSerialize(node.Block))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Block"),
						Serialize(node.Block)));
			}
			Push(mie);
		}

		override public void OnTryStatement(Milo.Ast.TryStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.TryStatement"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			if (ShouldSerialize(node.ProtectedBlock))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ProtectedBlock"),
						Serialize(node.ProtectedBlock)));
			}
			if (ShouldSerialize(node.ExceptionHandlers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("ExceptionHandlers"),
						SerializeCollection("Milo.Ast.ExceptionHandlerCollection", node.ExceptionHandlers)));
			}
			if (ShouldSerialize(node.EnsureBlock))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("EnsureBlock"),
						Serialize(node.EnsureBlock)));
			}
			Push(mie);
		}

		override public void OnExceptionHandler(Milo.Ast.ExceptionHandler node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.ExceptionHandler"));
			if (ShouldSerialize(node.Declaration))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Declaration"),
						Serialize(node.Declaration)));
			}
			if (ShouldSerialize(node.Block))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Block"),
						Serialize(node.Block)));
			}
			Push(mie);
		}

		override public void OnIfStatement(Milo.Ast.IfStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.IfStatement"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			if (ShouldSerialize(node.Condition))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Condition"),
						Serialize(node.Condition)));
			}
			if (ShouldSerialize(node.TrueBlock))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("TrueBlock"),
						Serialize(node.TrueBlock)));
			}
			if (ShouldSerialize(node.FalseBlock))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("FalseBlock"),
						Serialize(node.FalseBlock)));
			}
			Push(mie);
		}

		override public void OnUnlessStatement(Milo.Ast.UnlessStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.UnlessStatement"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			if (ShouldSerialize(node.Condition))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Condition"),
						Serialize(node.Condition)));
			}
			if (ShouldSerialize(node.Block))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Block"),
						Serialize(node.Block)));
			}
			Push(mie);
		}

		override public void OnForStatement(Milo.Ast.ForStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.ForStatement"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			if (ShouldSerialize(node.Declarations))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Declarations"),
						SerializeCollection("Milo.Ast.DeclarationCollection", node.Declarations)));
			}
			if (ShouldSerialize(node.Iterator))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Iterator"),
						Serialize(node.Iterator)));
			}
			if (ShouldSerialize(node.Block))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Block"),
						Serialize(node.Block)));
			}
			Push(mie);
		}

		override public void OnWhileStatement(Milo.Ast.WhileStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.WhileStatement"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			if (ShouldSerialize(node.Condition))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Condition"),
						Serialize(node.Condition)));
			}
			if (ShouldSerialize(node.Block))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Block"),
						Serialize(node.Block)));
			}
			Push(mie);
		}

		override public void OnBreakStatement(Milo.Ast.BreakStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.BreakStatement"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			Push(mie);
		}

		override public void OnContinueStatement(Milo.Ast.ContinueStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.ContinueStatement"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			Push(mie);
		}

		override public void OnReturnStatement(Milo.Ast.ReturnStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.ReturnStatement"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			if (ShouldSerialize(node.Expression))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Expression"),
						Serialize(node.Expression)));
			}
			Push(mie);
		}

		override public void OnYieldStatement(Milo.Ast.YieldStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.YieldStatement"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			if (ShouldSerialize(node.Expression))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Expression"),
						Serialize(node.Expression)));
			}
			Push(mie);
		}

		override public void OnRaiseStatement(Milo.Ast.RaiseStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.RaiseStatement"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			if (ShouldSerialize(node.Exception))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Exception"),
						Serialize(node.Exception)));
			}
			Push(mie);
		}

		override public void OnUnpackStatement(Milo.Ast.UnpackStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.UnpackStatement"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			if (ShouldSerialize(node.Declarations))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Declarations"),
						SerializeCollection("Milo.Ast.DeclarationCollection", node.Declarations)));
			}
			if (ShouldSerialize(node.Expression))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Expression"),
						Serialize(node.Expression)));
			}
			Push(mie);
		}

		override public void OnExpressionStatement(Milo.Ast.ExpressionStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.ExpressionStatement"));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Modifier"),
						Serialize(node.Modifier)));
			}
			if (ShouldSerialize(node.Expression))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Expression"),
						Serialize(node.Expression)));
			}
			Push(mie);
		}

		override public void OnExpressionPair(Milo.Ast.ExpressionPair node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.ExpressionPair"));
			if (ShouldSerialize(node.First))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("First"),
						Serialize(node.First)));
			}
			if (ShouldSerialize(node.Second))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Second"),
						Serialize(node.Second)));
			}
			Push(mie);
		}

		override public void OnMethodInvocationExpression(Milo.Ast.MethodInvocationExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.MethodInvocationExpression"));
			if (ShouldSerialize(node.Target))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Target"),
						Serialize(node.Target)));
			}
			if (ShouldSerialize(node.Arguments))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Arguments"),
						SerializeCollection("Milo.Ast.ExpressionCollection", node.Arguments)));
			}
			if (ShouldSerialize(node.NamedArguments))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("NamedArguments"),
						SerializeCollection("Milo.Ast.ExpressionPairCollection", node.NamedArguments)));
			}
			Push(mie);
		}

		override public void OnUnaryExpression(Milo.Ast.UnaryExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.UnaryExpression"));
			if (ShouldSerialize(node.Operator))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Operator"),
						Serialize(node.Operator)));
			}
			if (ShouldSerialize(node.Operand))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Operand"),
						Serialize(node.Operand)));
			}
			Push(mie);
		}

		override public void OnBinaryExpression(Milo.Ast.BinaryExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.BinaryExpression"));
			if (ShouldSerialize(node.Operator))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Operator"),
						Serialize(node.Operator)));
			}
			if (ShouldSerialize(node.Left))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Left"),
						Serialize(node.Left)));
			}
			if (ShouldSerialize(node.Right))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Right"),
						Serialize(node.Right)));
			}
			Push(mie);
		}

		override public void OnConditionalExpression(Milo.Ast.ConditionalExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.ConditionalExpression"));
			if (ShouldSerialize(node.Condition))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Condition"),
						Serialize(node.Condition)));
			}
			if (ShouldSerialize(node.TrueValue))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("TrueValue"),
						Serialize(node.TrueValue)));
			}
			if (ShouldSerialize(node.FalseValue))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("FalseValue"),
						Serialize(node.FalseValue)));
			}
			Push(mie);
		}

		override public void OnReferenceExpression(Milo.Ast.ReferenceExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.ReferenceExpression"));
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			Push(mie);
		}

		override public void OnMemberReferenceExpression(Milo.Ast.MemberReferenceExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.MemberReferenceExpression"));
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Target))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Target"),
						Serialize(node.Target)));
			}
			Push(mie);
		}

		override public void OnGenericReferenceExpression(Milo.Ast.GenericReferenceExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.GenericReferenceExpression"));
			if (ShouldSerialize(node.Target))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Target"),
						Serialize(node.Target)));
			}
			if (ShouldSerialize(node.GenericArguments))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("GenericArguments"),
						SerializeCollection("Milo.Ast.TypeReferenceCollection", node.GenericArguments)));
			}
			Push(mie);
		}

		override public void OnSpliceExpression(Milo.Ast.SpliceExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.SpliceExpression"));
			if (ShouldSerialize(node.Expression))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Expression"),
						Serialize(node.Expression)));
			}
			Push(mie);
		}

		override public void OnCodeLiteralExpression(Milo.Ast.CodeLiteralExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.CodeLiteralExpression"));
			if (ShouldSerialize(node.Node))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Node"),
						Serialize(node.Node)));
			}
			Push(mie);
		}

		override public void OnStringLiteralExpression(Milo.Ast.StringLiteralExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.StringLiteralExpression"));
			if (ShouldSerialize(node.Value))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Value"),
						Serialize(node.Value)));
			}
			Push(mie);
		}

		override public void OnCharLiteralExpression(Milo.Ast.CharLiteralExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.CharLiteralExpression"));
			if (ShouldSerialize(node.Value))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Value"),
						Serialize(node.Value)));
			}
			Push(mie);
		}

		override public void OnTimeSpanLiteralExpression(Milo.Ast.TimeSpanLiteralExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.TimeSpanLiteralExpression"));
			if (ShouldSerialize(node.Value))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Value"),
						Serialize(node.Value)));
			}
			Push(mie);
		}

		override public void OnIntegerLiteralExpression(Milo.Ast.IntegerLiteralExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.IntegerLiteralExpression"));
			if (ShouldSerialize(node.Value))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Value"),
						Serialize(node.Value)));
			}
			if (ShouldSerialize(node.IsLong))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("IsLong"),
						Serialize(node.IsLong)));
			}
			Push(mie);
		}

		override public void OnDoubleLiteralExpression(Milo.Ast.DoubleLiteralExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.DoubleLiteralExpression"));
			if (ShouldSerialize(node.Value))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Value"),
						Serialize(node.Value)));
			}
			if (ShouldSerialize(node.IsSingle))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("IsSingle"),
						Serialize(node.IsSingle)));
			}
			Push(mie);
		}

		override public void OnNullLiteralExpression(Milo.Ast.NullLiteralExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.NullLiteralExpression"));
			Push(mie);
		}

		override public void OnSelfLiteralExpression(Milo.Ast.SelfLiteralExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.SelfLiteralExpression"));
			Push(mie);
		}

		override public void OnSuperLiteralExpression(Milo.Ast.SuperLiteralExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.SuperLiteralExpression"));
			Push(mie);
		}

		override public void OnBoolLiteralExpression(Milo.Ast.BoolLiteralExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.BoolLiteralExpression"));
			if (ShouldSerialize(node.Value))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Value"),
						Serialize(node.Value)));
			}
			Push(mie);
		}

		override public void OnRELiteralExpression(Milo.Ast.RELiteralExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.RELiteralExpression"));
			if (ShouldSerialize(node.Value))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Value"),
						Serialize(node.Value)));
			}
			Push(mie);
		}

		override public void OnExpressionInterpolationExpression(Milo.Ast.ExpressionInterpolationExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.ExpressionInterpolationExpression"));
			if (ShouldSerialize(node.Expressions))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Expressions"),
						SerializeCollection("Milo.Ast.ExpressionCollection", node.Expressions)));
			}
			Push(mie);
		}

		override public void OnHashLiteralExpression(Milo.Ast.HashLiteralExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.HashLiteralExpression"));
			if (ShouldSerialize(node.Items))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Items"),
						SerializeCollection("Milo.Ast.ExpressionPairCollection", node.Items)));
			}
			Push(mie);
		}

		override public void OnListLiteralExpression(Milo.Ast.ListLiteralExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.ListLiteralExpression"));
			if (ShouldSerialize(node.Items))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Items"),
						SerializeCollection("Milo.Ast.ExpressionCollection", node.Items)));
			}
			Push(mie);
		}

		override public void OnArrayLiteralExpression(Milo.Ast.ArrayLiteralExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.ArrayLiteralExpression"));
			if (ShouldSerialize(node.Items))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Items"),
						SerializeCollection("Milo.Ast.ExpressionCollection", node.Items)));
			}
			if (ShouldSerialize(node.Type))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Type"),
						Serialize(node.Type)));
			}
			Push(mie);
		}

		override public void OnGeneratorExpression(Milo.Ast.GeneratorExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.GeneratorExpression"));
			if (ShouldSerialize(node.Expression))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Expression"),
						Serialize(node.Expression)));
			}
			if (ShouldSerialize(node.Declarations))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Declarations"),
						SerializeCollection("Milo.Ast.DeclarationCollection", node.Declarations)));
			}
			if (ShouldSerialize(node.Iterator))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Iterator"),
						Serialize(node.Iterator)));
			}
			if (ShouldSerialize(node.Filter))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Filter"),
						Serialize(node.Filter)));
			}
			Push(mie);
		}

		override public void OnExtendedGeneratorExpression(Milo.Ast.ExtendedGeneratorExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.ExtendedGeneratorExpression"));
			if (ShouldSerialize(node.Items))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Items"),
						SerializeCollection("Milo.Ast.GeneratorExpressionCollection", node.Items)));
			}
			Push(mie);
		}

		override public void OnSlice(Milo.Ast.Slice node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.Slice"));
			if (ShouldSerialize(node.Begin))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Begin"),
						Serialize(node.Begin)));
			}
			if (ShouldSerialize(node.End))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("End"),
						Serialize(node.End)));
			}
			if (ShouldSerialize(node.Step))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Step"),
						Serialize(node.Step)));
			}
			Push(mie);
		}

		override public void OnSlicingExpression(Milo.Ast.SlicingExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.SlicingExpression"));
			if (ShouldSerialize(node.Target))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Target"),
						Serialize(node.Target)));
			}
			if (ShouldSerialize(node.Indices))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Indices"),
						SerializeCollection("Milo.Ast.SliceCollection", node.Indices)));
			}
			Push(mie);
		}

		override public void OnTryCastExpression(Milo.Ast.TryCastExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.TryCastExpression"));
			if (ShouldSerialize(node.Target))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Target"),
						Serialize(node.Target)));
			}
			if (ShouldSerialize(node.Type))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Type"),
						Serialize(node.Type)));
			}
			Push(mie);
		}

		override public void OnCastExpression(Milo.Ast.CastExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.CastExpression"));
			if (ShouldSerialize(node.Target))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Target"),
						Serialize(node.Target)));
			}
			if (ShouldSerialize(node.Type))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Type"),
						Serialize(node.Type)));
			}
			Push(mie);
		}

		override public void OnTypeofExpression(Milo.Ast.TypeofExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference("Milo.Ast.TypeofExpression"));
			if (ShouldSerialize(node.Type))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						new ReferenceExpression("Type"),
						Serialize(node.Type)));
			}
			Push(mie);
		}

	}
}

